home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / Controls.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  11.1 KB  |  341 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Controls.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __CONTROLS__
  13. #define __CONTROLS__
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. /*    #include <Types.h>                                            */
  18. /*        #include <ConditionalMacros.h>                            */
  19. /*        #include <MixedMode.h>                                    */
  20. /*            #include <Traps.h>                                    */
  21. /*    #include <QuickdrawText.h>                                    */
  22. /*        #include <IntlResources.h>                                */
  23. #endif
  24.  
  25. #ifndef __MENUS__
  26. #include <Menus.h>
  27. #endif
  28.  
  29. enum  {
  30.     pushButProc                    = 0,
  31.     checkBoxProc                = 1,
  32.     radioButProc                = 2,
  33.     useWFont                    = 8,
  34.     scrollBarProc                = 16,
  35.     inButton                    = 10,
  36.     inCheckBox                    = 11,
  37.     inUpButton                    = 20,
  38.     inDownButton                = 21,
  39.     inPageUp                    = 22,
  40.     inPageDown                    = 23,
  41.     inThumb                        = 129,
  42.     popupMenuProc                = 1008,                            /* 63 * 16 */
  43.     inLabel                        = 1,
  44.     inMenu                        = 2,
  45.     inTriangle                    = 4
  46. };
  47.  
  48. enum  {
  49.     popupFixedWidth                = 1 << 0,
  50.     popupVariableWidth            = 1 << 1,
  51.     popupUseAddResMenu            = 1 << 2,
  52.     popupUseWFont                = 1 << 3
  53. };
  54.  
  55. enum  {
  56.     popupTitleBold                = 1 << 8,
  57.     popupTitleItalic            = 1 << 9,
  58.     popupTitleUnderline            = 1 << 10,
  59.     popupTitleOutline            = 1 << 11,
  60.     popupTitleShadow            = 1 << 12,
  61.     popupTitleCondense            = 1 << 13,
  62.     popupTitleExtend            = 1 << 14,
  63.     popupTitleNoStyle            = 1 << 15
  64. };
  65.  
  66. enum  {
  67.     popupTitleLeftJust            = 0x00000000,
  68.     popupTitleCenterJust        = 0x00000001,
  69.     popupTitleRightJust            = 0x000000FF,
  70. /*
  71. axis constraints for DragGrayRgn call*/
  72.     noConstraint                = 0,
  73.     hAxisOnly                    = 1,
  74.     vAxisOnly                    = 2,
  75. /*
  76. control messages*/
  77.     drawCntl                    = 0,
  78.     testCntl                    = 1,
  79.     calcCRgns                    = 2,
  80.     initCntl                    = 3,
  81.     dispCntl                    = 4,
  82.     posCntl                        = 5,
  83.     thumbCntl                    = 6,
  84.     dragCntl                    = 7,
  85.     autoTrack                    = 8,
  86.     calcCntlRgn                    = 10,
  87.     calcThumbRgn                = 11,
  88.     cFrameColor                    = 0,
  89.     cBodyColor                    = 1,
  90.     cTextColor                    = 2
  91. };
  92.  
  93. enum  {
  94.     cThumbColor                    = 3
  95. };
  96.  
  97. typedef struct ControlRecord ControlRecord, *ControlPtr, **ControlHandle;
  98.  
  99. typedef pascal long (*ControlDefProcPtr)(short varCode, ControlHandle theControl, short message, long param);
  100.  
  101. enum {
  102.     uppControlDefProcInfo = kPascalStackBased
  103.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  104.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  105.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ControlHandle)))
  106.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  107.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  108. };
  109.  
  110. #if USESROUTINEDESCRIPTORS
  111. typedef UniversalProcPtr ControlDefUPP;
  112.  
  113. #define CallControlDefProc(userRoutine, varCode, theControl, message, param)        \
  114.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlDefProcInfo, (varCode), (theControl), (message), (param))
  115. #define NewControlDefProc(userRoutine)        \
  116.         (ControlDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlDefProcInfo, GetCurrentISA())
  117. #else
  118. typedef ControlDefProcPtr ControlDefUPP;
  119.  
  120. #define CallControlDefProc(userRoutine, varCode, theControl, message, param)        \
  121.         (*(userRoutine))((varCode), (theControl), (message), (param))
  122. #define NewControlDefProc(userRoutine)        \
  123.         (ControlDefUPP)(userRoutine)
  124. #endif
  125.  
  126. typedef pascal void (*ControlActionProcPtr)(ControlHandle theControl, short partCode);
  127.  
  128. enum {
  129.     uppControlActionProcInfo = kPascalStackBased
  130.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlHandle)))
  131.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(short)))
  132. };
  133.  
  134. #if USESROUTINEDESCRIPTORS
  135. typedef UniversalProcPtr ControlActionUPP;
  136.  
  137. #define CallControlActionProc(userRoutine, theControl, partCode)        \
  138.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlActionProcInfo, (theControl), (partCode))
  139. #define NewControlActionProc(userRoutine)        \
  140.         (ControlActionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlActionProcInfo, GetCurrentISA())
  141. #else
  142. typedef ControlActionProcPtr ControlActionUPP;
  143.  
  144. #define CallControlActionProc(userRoutine, theControl, partCode)        \
  145.         (*(userRoutine))((theControl), (partCode))
  146. #define NewControlActionProc(userRoutine)        \
  147.         (ControlActionUPP)(userRoutine)
  148. #endif
  149.  
  150. #if defined(powerc) || defined (__powerc)
  151. #pragma options align=mac68k
  152. #endif
  153. struct ControlRecord {
  154.     ControlHandle                nextControl;
  155.     WindowPtr                    contrlOwner;
  156.     Rect                        contrlRect;
  157.     unsigned char                contrlVis;
  158.     unsigned char                contrlHilite;
  159.     short                        contrlValue;
  160.     short                        contrlMin;
  161.     short                        contrlMax;
  162.     Handle                        contrlDefProc;
  163.     Handle                        contrlData;
  164.     ControlActionUPP            contrlAction;
  165.     long                        contrlRfCon;
  166.     Str255                        contrlTitle;
  167. };
  168. #if defined(powerc) || defined(__powerc)
  169. #pragma options align=reset
  170. #endif
  171.  
  172. #if defined(powerc) || defined (__powerc)
  173. #pragma options align=mac68k
  174. #endif
  175. struct PopupPrivateData {
  176.     MenuHandle                    mHandle;                        /*popup menu handle*/
  177.     short                        mID;                            /*popup menu ID*/
  178. };
  179. #if defined(powerc) || defined(__powerc)
  180. #pragma options align=reset
  181. #endif
  182.  
  183. typedef struct PopupPrivateData PopupPrivateData;
  184.  
  185. typedef PopupPrivateData *PopupPrivateDataPtr, **PopupPrivateDataHandle;
  186.  
  187. #if defined(powerc) || defined (__powerc)
  188. #pragma options align=mac68k
  189. #endif
  190. struct CtlCTab {
  191.     long                        ccSeed;                            /*reserved*/
  192.     short                        ccRider;                        /*see what you have done - reserved*/
  193.     short                        ctSize;                            /*usually 3 for controls*/
  194.     ColorSpec                    ctTable[4];
  195. };
  196. #if defined(powerc) || defined(__powerc)
  197. #pragma options align=reset
  198. #endif
  199.  
  200. typedef struct CtlCTab CtlCTab;
  201.  
  202. typedef CtlCTab *CCTabPtr, **CCTabHandle;
  203.  
  204. #if defined(powerc) || defined (__powerc)
  205. #pragma options align=mac68k
  206. #endif
  207. struct AuxCtlRec {
  208.     Handle                        acNext;                            /*handle to next AuxCtlRec*/
  209.     ControlHandle                acOwner;                        /*handle for aux record's control*/
  210.     CCTabHandle                    acCTable;                        /*color table for this control*/
  211.     short                        acFlags;                        /*misc flag byte*/
  212.     long                        acReserved;                        /*reserved for use by Apple*/
  213.     long                        acRefCon;                        /*for use by application*/
  214. };
  215. #if defined(powerc) || defined(__powerc)
  216. #pragma options align=reset
  217. #endif
  218.  
  219. typedef struct AuxCtlRec AuxCtlRec;
  220.  
  221. typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHandle;
  222.  
  223. #ifdef __cplusplus
  224. extern "C" {
  225. #endif
  226.  
  227. extern pascal ControlHandle NewControl(WindowPtr theWindow, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short value, short min, short max, short procID, long refCon)
  228.  ONEWORDINLINE(0xA954);
  229. extern pascal void SetControlTitle(ControlHandle theControl, ConstStr255Param title)
  230.  ONEWORDINLINE(0xA95F);
  231. extern pascal void GetControlTitle(ControlHandle theControl, Str255 title)
  232.  ONEWORDINLINE(0xA95E);
  233. extern pascal ControlHandle GetNewControl(short controlID, WindowPtr owner)
  234.  ONEWORDINLINE(0xA9BE);
  235. extern pascal void DisposeControl(ControlHandle theControl)
  236.  ONEWORDINLINE(0xA955);
  237. extern pascal void KillControls(WindowPtr theWindow)
  238.  ONEWORDINLINE(0xA956);
  239. extern pascal void HideControl(ControlHandle theControl)
  240.  ONEWORDINLINE(0xA958);
  241. extern pascal void ShowControl(ControlHandle theControl)
  242.  ONEWORDINLINE(0xA957);
  243. extern pascal void DrawControls(WindowPtr theWindow)
  244.  ONEWORDINLINE(0xA969);
  245. extern pascal void Draw1Control(ControlHandle theControl)
  246.  ONEWORDINLINE(0xA96D);
  247. extern pascal void HiliteControl(ControlHandle theControl, short hiliteState)
  248.  ONEWORDINLINE(0xA95D);
  249. extern pascal void UpdateControls(WindowPtr theWindow, RgnHandle updateRgn)
  250.  ONEWORDINLINE(0xA953);
  251. extern pascal void MoveControl(ControlHandle theControl, short h, short v)
  252.  ONEWORDINLINE(0xA959);
  253. extern pascal void SizeControl(ControlHandle theControl, short w, short h)
  254.  ONEWORDINLINE(0xA95C);
  255. extern pascal void SetControlValue(ControlHandle theControl, short theValue)
  256.  ONEWORDINLINE(0xA963);
  257. extern pascal short GetControlValue(ControlHandle theControl)
  258.  ONEWORDINLINE(0xA960);
  259. extern pascal void SetControlMinimum(ControlHandle theControl, short minValue)
  260.  ONEWORDINLINE(0xA964);
  261. extern pascal short GetControlMinimum(ControlHandle theControl)
  262.  ONEWORDINLINE(0xA961);
  263. extern pascal void SetControlMaximum(ControlHandle theControl, short maxValue)
  264.  ONEWORDINLINE(0xA965);
  265. extern pascal short GetControlMaximum(ControlHandle theControl)
  266.  ONEWORDINLINE(0xA962);
  267. extern pascal void SetControlReference(ControlHandle theControl, long data)
  268.  ONEWORDINLINE(0xA95B);
  269. extern pascal long GetControlReference(ControlHandle theControl)
  270.  ONEWORDINLINE(0xA95A);
  271. extern pascal void SetControlAction(ControlHandle theControl, ControlActionUPP actionProc)
  272.  ONEWORDINLINE(0xA96B);
  273. extern pascal ControlActionUPP GetControlAction(ControlHandle theControl)
  274.  ONEWORDINLINE(0xA96A);
  275. extern pascal void DragControl(ControlHandle theControl, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis)
  276.  ONEWORDINLINE(0xA967);
  277. extern pascal short TestControl(ControlHandle theControl, Point thePt)
  278.  ONEWORDINLINE(0xA966);
  279. extern pascal short TrackControl(ControlHandle theControl, Point thePoint, ControlActionUPP actionProc)
  280.  ONEWORDINLINE(0xA968);
  281. extern pascal short FindControl(Point thePoint, WindowPtr theWindow, ControlHandle *theControl)
  282.  ONEWORDINLINE(0xA96C);
  283. extern pascal void SetControlColor(ControlHandle theControl, CCTabHandle newColorTable)
  284.  ONEWORDINLINE(0xAA43);
  285. extern pascal Boolean GetAuxiliaryControlRecord(ControlHandle theControl, AuxCtlHandle *acHndl)
  286.  ONEWORDINLINE(0xAA44);
  287. extern pascal short GetControlVariant(ControlHandle theControl)
  288.  ONEWORDINLINE(0xA809);
  289. extern void dragcontrol(ControlHandle theControl, Point *startPt, const Rect *limitRect, const Rect *slopRect, short axis);
  290. extern ControlHandle newcontrol(WindowPtr theWindow, const Rect *boundsRect, char *title, Boolean visible, short value, short min, short max, short procID, long refCon);
  291. extern short findcontrol(Point *thePoint, WindowPtr theWindow, ControlHandle *theControl);
  292. extern void getcontroltitle(ControlHandle theControl, char *title);
  293. extern void setcontroltitle(ControlHandle theControl, char *title);
  294. extern short trackcontrol(ControlHandle theControl, Point *thePoint, ControlActionUPP actionProc);
  295. extern short testcontrol(ControlHandle theControl, Point *thePt);
  296. #if OLDROUTINENAMES
  297. #define SetCTitle(theControl, title) SetControlTitle(theControl, title)
  298.  
  299. #define GetCTitle(theControl, title) GetControlTitle(theControl, title)
  300.  
  301. #define UpdtControl(theWindow, updateRgn) UpdateControls(theWindow, updateRgn)
  302.  
  303. #define SetCtlValue(theControl, theValue) SetControlValue(theControl, theValue)
  304.  
  305. #define GetCtlValue(theControl) GetControlValue(theControl)
  306.  
  307. #define SetCtlMin(theControl, minValue) SetControlMinimum(theControl, minValue)
  308.  
  309. #define GetCtlMin(theControl) GetControlMinimum(theControl)
  310.  
  311. #define SetCtlMax(theControl, maxValue) SetControlMaximum(theControl, maxValue)
  312.  
  313. #define GetCtlMax(theControl) GetControlMaximum(theControl)
  314.  
  315. #define SetCRefCon(theControl, data) SetControlReference(theControl, data)
  316.  
  317. #define GetCRefCon(theControl) GetControlReference(theControl)
  318.  
  319. #define SetCtlAction(theControl, actionProc) SetControlAction(theControl, actionProc)
  320.  
  321. #define GetCtlAction(theControl) GetControlAction(theControl)
  322.  
  323. #define SetCtlColor(theControl, newColorTable) SetControlColor(theControl, newColorTable)
  324.  
  325. #define GetAuxCtl(theControl, acHndl) GetAuxiliaryControlRecord(theControl, acHndl)
  326.  
  327. #define GetCVariant(theControl) GetControlVariant(theControl)
  328.  
  329. #define getctitle(theControl, title) getcontroltitle(theControl, title)
  330.  
  331. #define setctitle(theControl, title) setcontroltitle(theControl, title)
  332.  
  333. #endif
  334.  
  335. #ifdef __cplusplus
  336. }
  337. #endif
  338.  
  339. #endif
  340.  
  341.